﻿using System.Collections;
using System.Collections.Generic;

using Dict.DataModel;
namespace Dict.Blo
{
    
    public class DictPetBreachBlo
    {

        /// <summary>
        /// 获取宠物突破信息
        /// </summary>
        /// <param name="talentId"></param>
        /// <param name="breachLevel"></param>
        /// <returns></returns>
        public static TablePetTalent GetPetBreachTalent(string talentId,int breachLevel)
        {
            List<TablePetTalent> list = Dict.DictDataManager.Instance.tablePetTalentDao.GetByOneIndex(talentId);
            //var talentConst = 
            return list[breachLevel];
        }

        /// <summary>
        /// 获取宠物突破时需要消耗的数据
        /// </summary>
        /// <param name="petId"></param>
        /// <param name="breachLevel"></param>
        /// <returns></returns>
        public static TablePetTalentMaterial GetPetBreachLevelData(string petId,int breachLevel)
        {
            List<TablePetTalentMaterial> list = Dict.DictDataManager.Instance.tablePetTalentMaterialDao.GetByOneIndex(petId);
            return list[breachLevel];
        }

        /// <summary>
        /// 宠物突破最大等级
        /// </summary>
        /// <param name="petId"></param>
        /// <param name="breachLevel"></param>
        /// <returns></returns>
        public static int GetPetBreachMaxLevel(string petId,int breachLevel)
        {
            int breachMaxLevel = 0;
            List<TablePetTalentMaterial> list = Dict.DictDataManager.Instance.tablePetTalentMaterialDao.GetByOneIndex(petId);
            if (list == null)
            {
                return 0;
            }

            foreach (var data in list)
            {
               if(breachLevel > data.talentLevel)
               {
                    breachMaxLevel = data.talentLevel;
                    break;
               }
               else
               {

               }
            }
            return breachMaxLevel;
        }
    }
}
